package com.request.strategy;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestParam;

import java.lang.annotation.Annotation;

/**
 * @author yuanqinglong
 * @since 2021/10/18 12:08
 */
@Component
public class RequestParamProcessor implements RequestParamTypeProcess {


    @Override
    public Class<?> paramType() {
        return RequestParam.class;
    }


    @Override
    public void process(JSONObject requestData, Annotation annotationType, Object args) {
        RequestParam requestParam = (RequestParam) annotationType;
        requestData.put(requestParam.value(), args);
    }


}
